#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using i128 = __int128;
const int N = 1e6 + 5;

void solve(int i) {
    int n;
    cin >> n;
    vector<ll> v(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
    ll result = 0;
    for (int bit = 20; bit >= 0; --bit) {
        ll temp = result | (1LL << bit);
        int count = 0;
        for (ll num : v) {
            if ((num & temp) == temp) {
                ++count;
                if (count >= 2) {
                    result = temp;
                    break;
                }
            }
        }
    }
    cout << "Case #" << i << ": " << result << endl;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;
    for (int i = 1; i <= t; ++i) {
        solve(i);
    }

    return 0;
}